package classAndStudent;

public class Student {
    private final String name;
    private final int age;
    private final String gender;
    private final double[] scores; // 存放6门课的成绩

    public Student(String name, int age, String gender, double[] scores) {
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.scores = scores;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public String getGender() {
        return gender;
    }

    public double[] getScores() {
        return scores;
    }

    public double getTotalScore() {
        double total = 0;
        for (double score : scores) {
            total += score;
        }
        return total;
    }
}
